package sample.plugin.http.menu;

import android.graphics.drawable.Drawable;

import com.rapid.api.framework.domain.menu.BaseDomainMenuAction;
import com.rapid.api.framework.domain.window.WindowService;
import com.rapid.framework.data.DataHolder;
import com.rapid.framework.extension.annotation.Import;

import java.net.URI;

import sample.plugin.http.window.TempRequestVirtualFile;

public class RequestMenuAction extends BaseDomainMenuAction {
    @Import
    WindowService windowService;

    @Override
    public String getParentId() {
        return ID_TOOL;
    }

    @Override
    public String getId() {
        return "http-request";
    }

    @Override
    public String getTitle() {
        return "网络请求";
    }

    @Override
    public Drawable getIcon() {
        return null;
    }

    @Override
    public void perform(DataHolder dataHolder) {
        TempRequestVirtualFile virtualFile = new TempRequestVirtualFile("网络请求.req");
        windowService.openVirtualFile(virtualFile);
    }
}
